﻿@model Apps.Models.Spl.Spl_WareStockPileModel
@using Apps.Web.Core;
@using Apps.Common;
@using Apps.Models.Spl;
@using Apps.Web;
@using Apps.Locale;
@using Apps.Models.Sys;
@{
    ViewBag.Title = "创建";
    Layout = "~/Views/Shared/_Index_LayoutEdit.cshtml";
    List<permModel> perm = null;
}

<script type="text/javascript">
$(function () {
    $("#btnSave").click(function () {
        if ($("form").valid()) {
            $.ajax({
                url: "@Url.Action("Create")",
                type: "Post",
                data: $("form").serialize(),
                dataType: "json",
                success: function (data) {
                    if (data.type == 1) {
                        window.parent.frameReturnByMes(data.message);
                        window.parent.frameReturnByReload(true);
                        window.parent.frameReturnByClose()
                    }
                    else {
                        window.parent.frameReturnByMes(data.message);
                    }
                }
            });
        }
        return false;
    });
    $("#btnReturn").click(function () {
         window.parent.frameReturnByClose();
    });
});
function frameReturnByClose() {
$("#modalwindow").window('close');
}
function frameReturnByMes(mes) {
$.messageBox5s(Lang.Tip, mes);
}
</script>
<div id="modalwindow" class="easyui-window" style="width:800px; height:400px;" data-options="modal:true,closed:true,minimizable:false,shadow:false"></div>
<div class="mvctool bgb">
@Html.ToolButton("btnSave", "fa fa-save", Resource.Save,ref perm, "Save", true)
@Html.ToolButton("btnReturn", "fa fa-reply", Resource.Reply,false)
</div>
@using (Html.BeginForm())
{
             @Html.HiddenFor(model => model.Id)
             <input id="CreateTime" type="hidden" name="CreateTime" value="2000-1-1" />
 <table class="formtable">
    <tbody>
        <tr>
            <th>
                @Html.LabelFor(model => model.WarehouseId)：
            </th>
            <td>
                 @Html.DropDownListFor(model => model.WarehouseId, ViewBag.Warehouse as SelectList)
            </td>
            <td>@Html.ValidationMessageFor(model => model.WarehouseId)</td>
        </tr>
        <tr>
            <th>
                @Html.LabelFor(model => model.WareDetailsId)：
            </th>
            <td>
                @Html.EditorFor(model => model.WareDetailsId)
            </td>
            <td>@Html.ValidationMessageFor(model => model.WareDetailsId)</td>
        </tr>
        <tr>
            <th>
                @Html.LabelFor(model => model.FirstEnterDate)：
            </th>
            <td >
               @Html.TextBoxFor(model => model.FirstEnterDate, new { @onClick = "WdatePicker()",@style = "width: 105px" })
            </td>
            <td>@Html.ValidationMessageFor(model => model.FirstEnterDate)</td>
        </tr>
        <tr>
            <th>
                @Html.LabelFor(model => model.LastLeaveDate)：
            </th>
            <td >
               @Html.TextBoxFor(model => model.LastLeaveDate, new { @onClick = "WdatePicker()",@style = "width: 105px" })
            </td>
            <td>@Html.ValidationMessageFor(model => model.LastLeaveDate)</td>
        </tr>
        <tr>
            <th>
                @Html.LabelFor(model => model.Quantity)：
            </th>
            <td>
                @Html.EditorFor(model => model.Quantity)
            </td>
            <td>@Html.ValidationMessageFor(model => model.Quantity)</td>
        </tr>
        <tr>
            <th>
                @Html.LabelFor(model => model.Price)：
            </th>
            <td>
                @Html.EditorFor(model => model.Price)
            </td>
            <td>@Html.ValidationMessageFor(model => model.Price)</td>
        </tr>
    </tbody>
</table>
}

